package com.example.myapplication;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;

public class show extends AppCompatActivity {
    private SeekBar nt;
    private TextView springs;
    private Context mcontext;
   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mcontext=show.this;
        bindViews();


        }
    private void bindViews() {
        nt = (SeekBar) findViewById(R.id.seekbar_nomal);
        springs = (TextView) findViewById(R.id.seekbar);
        nt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                springs.setText( + progress + "元");
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
                Toast.makeText(mcontext, "触碰SeekBar", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                Toast.makeText(mcontext, "放开SeekBar", Toast.LENGTH_SHORT).show();
            }
        });
    }



}
